////////////////////////////////////////////////////////////////////////////////
//                                                                            //
//                           BailterRay                                       //
//                    Pip Robbins & Zhao Zhang                                //
//                                                                            //
////////////////////////////////////////////////////////////////////////////////
class BailterRay_DimensionSwitch extends Teleporter;

var() float TeleportCooldown;

// Accept an actor that has teleported in.
simulated event bool Accept( actor Incoming, Actor Source )
{
	local BailterRayPawn P;
    local BailterRayPlayerController PC;

    if(bEnabled)
    {
	    P = BailterRayPawn(Incoming);
	    if (P == None || !P.IsPlayerPawn() || !P.IsHumanControlled())
	    {
	    	return false;
	    }
        PC = BailterRayPlayerController(P.Controller);
        PC.yGamePlane = location.y;
        bEnabled = false;
        setTimer(4, false, 'Cooldown');
        return super.Accept(incoming, source);
    }
    return false;

}

simulated function Cooldown()
{
    bEnabled = true;
}

defaultproperties
{
    TeleportCooldown = 4
    bStatic = false
}